import request from './index.js'

/**
 * 通用文件上传
 * @param {File} file 文件对象
 * @returns {Promise}
 */
export function uploadFile(file) {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: '/common/upload',
    method: 'POST',
    headers: {
      'Content-Type': 'multipart/form-data',
      // Authorization 自动在 request.js 拦截器里加
    },
    data: formData
  })
} 